﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MinistryStandardPlatformWeb.Models
{
    public class OilStatistics
    {
        public string Sim { get; set; }
        public string VehicleId { get; set; }
        public string ParentUnitName { get; set; }
        public string StatisticsTime { get; set; }
        public string Oil { get; set; }
    }


    public class OilStatisticsMileageEquality : IEqualityComparer<OilStatistics>
    {
        public bool Equals(OilStatistics x, OilStatistics y)
        {
            if (string.IsNullOrEmpty(x.Oil) && string.IsNullOrEmpty(y.Oil))
            {
                return true;
            }

            return x.Oil == y.Oil;
        }

        public int GetHashCode(OilStatistics obj)
        {
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return obj.ToString().GetHashCode();
            }
        }
    }

}